package com.example.timetask;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author jie
 * @date 2019/3/25 0025 -14:37
 */
@Component
public class MySecendJob extends QuartzJobBean {
    private String name;
    public void setName(String name){
        this.name= name;
    }


    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        System.out.println("hello:"+name+":"+new Date());
    }
}

